package modifier.tile;

import board.Tile;
import character.MyCharacter;

public class TileModifierSight extends TileModifier {
    
    @Deprecated
    protected TileModifierSight() {}
    
    public TileModifierSight(MyCharacter owner, int duration) {
        super(owner, duration);
    }

    @Override
    protected void apply() {
        super.apply();
        System.out.println("Revealing tile...");
	tile.setDiscovered(true);
	tile.setVisible(true);
    }

    @Override
    protected void tick() {
        super.tick();
    }

    @Override
    protected void completeNaturally() {
        super.completeNaturally();
        restoreVisibility();
    }

    @Override
    protected void abort() {
        super.abort();
        restoreVisibility();
    }
    
    protected void restoreVisibility() {
        System.out.println("Restoring tile visibility...");
    }

    @Override
    public TileModifier cloneForTile(Tile tile) {
        TileModifierSight clone = new TileModifierSight(owner, totalTicks);
        cloneMeForTile(clone, tile);
        return clone;
    }
}
